import { defineStore } from 'pinia'
import { ref, computed } from 'vue'

export const useCounterStore = defineStore(
  'counter',
  () => {
    // 记录用户登录状态
    const token = ref('')

    const setToken = (t: string) => {
      token.value = t
    }
    const clearToken = () => {
      token.value = ''
    }
    return { token, setToken, clearToken }
  },
  {
    unistorage: true,
  }
)
